public class FactoryPattern {
    public  static Computer createComputer(String info){
        switch (info) {
            case "huawei":
                Computer c = new HuaWei();
                c.setName("华为");
                c.setPrice(5999);
                return  c;
            case "Mac":
                Computer c1 =new Mac();
                c1.setName("苹果");
                c1.setPrice(5666);
                return c1;
            default:
                return null;
        }
    }
}
